//
//  ProductCollectionViewCell.m
//  LiWuShuo
//
//  Created by 袁小航 on 14/11/13.
//  Copyright (c) 2014年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "ProductCollectionViewCell.h"
#import "Define.h"
#import "ProCollectButton.h"

@implementation ProductCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
//        创建自定义商品cell
        [self createProCell];
        
    }
    return self;
}

#pragma mark -
#pragma mark 创建自定义商品cell
- (void)createProCell
{
    self.proImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, PRO_IMAGE_WIDTH, PRO_IMAGE_HEIGHT)];
    [self.contentView addSubview:_proImage];
    
    self.proInfoDarkImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, PRO_IMAGE_HEIGHT - PRO_INFOLABEL_Height - 20, PRO_IMAGE_WIDTH,  self.bounds.size.height / 3)];
//    _proInfoDarkImage.backgroundColor = [UIColor blackColor];
    [self.proInfoDarkImage setImage:[UIImage imageNamed:@"dest_place_title_shadow@2x.png"]];
    [self.contentView addSubview:_proInfoDarkImage];
    
    self.proInfo = [[UILabel alloc]initWithFrame:CGRectMake(0, PRO_IMAGE_HEIGHT - PRO_INFOLABEL_Height, PRO_IMAGE_WIDTH, PRO_INFOLABEL_Height)];
    UIColor * altColor = [UIColor colorWithWhite:0.1 alpha:0.6];
//    _proInfo.backgroundColor = altColor;
    _proInfo.textAlignment = YES;
    UIFont *font = [UIFont fontWithName:@"Helvetica-Bold" size:16];
    _proInfo.font = font;
    _proInfo.textColor = [UIColor whiteColor];
    [self.contentView addSubview:_proInfo];
    
    self.collectButton = [[ProCollectButton alloc]initWithFrame:CGRectMake(PRO_COLLECT_X, PRO_COLLECT_Y, PRO_IMAGE_WIDTH - PRO_COLLECT_X - 5, PRO_COLLECT_HEIGHT)];
    
    _collectButton.layer.cornerRadius = 10;
    _collectButton.layer.masksToBounds = YES;
    _collectButton.backgroundColor = altColor;
    _collectButton.collectNum.textColor = [UIColor whiteColor];
    _collectButton.collectNum.font = [UIFont systemFontOfSize:10];
    [self.contentView addSubview:_collectButton];
    
}




@end
